<!DOCTYPE html>
<html>
    <head>
        <title>向数组中添加元素  </title>
		<meta charset="utf-8" />
    </head>
    <body>

    </body>
    <script>
        /**
         * unshift(被添加元素)  push(被添加元素)
         * 返回值是数组长度
        */
        var currentDay = "星期四"
        var dayList = [currentDay];
        console.log(dayList.length);
        var newList = dayList.unshift("hello");
        console.log(newList);
        
        /**
         * arr.concat(arr1,arr2)
         * 会将arr,arr1,arr2合并，得到一个新数组，但是不会对arr产生影响
        */
        var arr1 = ["hello","world"];
        var arr2 = ["hello","JavaScript"];
        var arr3 = ["arr3"]; 
        var arr4 = arr1.concat(arr2,arr3);
        console.log(arr4);
        console.log(arr1);
    </script>
</html>